<?php
// $Id: matchdart.pages.inc 182 2010-03-13 17:49:35Z mwi.nor $

/**
 * @file
 * User page callbacks for the matchdart module.
 */

/**
 * Menu callback; prints the matchdart main listing.
 */
function matchdart_page($tid = 0) {
  if (!is_numeric($tid)) {
    return MENU_NOT_FOUND;
  }
  $tid = (int)$tid;

  $standings = '';
  $events_per_page = variable_get('events_per_page', 25);
  $sortby = variable_get('events_order', 1);

  $events = matchdart_get_events($tid);
  $parents = taxonomy_get_parents_all($tid);
  if ($tid && !in_array($tid, variable_get('matchdart_series', array()))) {
    $standings = matchdart_get_standings($tid);
  }

  //return theme('forums', $forums, $topics, $parents, $tid, $sortby, $forum_per_page);
  return theme('matchdart', $events, $ranking, $parents, $tid, $sortby, $events_per_page);
}
